package com.aolong.archives.core.sysmanage.servlet;

import javax.servlet.http.HttpServlet;

import com.aolong.archives.common.resource.ExceptionDictionaryUtil;
import com.aolong.archives.common.resource.DataDictionaryUtil;
import com.aolong.archives.common.resource.I18nBundleUtil;
import com.rock.platform.dao.IBaseDao;
import com.rock.platform.util.SpringContextUtil;

public class SystemInitializeServlet extends HttpServlet{

	private static final long serialVersionUID = 1L;

	public void init()
	{
		System.out.println("--------------------------");

		//add I18NResource
		IBaseDao dao = (IBaseDao)SpringContextUtil.getBean("al_BaseDao");
		I18nBundleUtil.getInstance().addResource(dao.getEntityManager(), "TSM_I18nResource", "Language", "ResourceKey", "Text");
		
		//add DataDictionary
		DataDictionaryUtil.getInstance().loadResource(dao.getEntityManager());
		
		//add DBExceptionDictionary	
		ExceptionDictionaryUtil.getInstance().loadResource(dao.getEntityManager());
		
		System.out.println("WebService init success");
		System.out.println("--------------------------");
	}
}
